package bonecp.bonecp_src_read;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import com.jolbox.bonecp.BoneCPConfig;

public class Test {
	private int code;
	public String name;
	protected boolean flag;
	

	private void tool(){
		for (Method method: Test.class.getDeclaredMethods()){
			System.out.println(method.getName() +"--"+method.getParameterTypes().length);
			if(method.getParameterTypes().length == 1 && method.getParameterTypes()[0].equals(int.class)){
				try {
					method.invoke(this, 1);
				} catch (IllegalArgumentException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (InvocationTargetException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Test test = new Test();
		test.tool();
		System.out.println(test.getCode());
		Field[] fields =  Test.class.getDeclaredFields();
		for (Field field: fields){
			System.out.println(field.getName()+"=="+field.getType()+"=="+field.getModifiers());
		}
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isFlag() {
		return flag;
	}
	public void setFlag(boolean flag) {
		this.flag = flag;
	}
	
	

}
